import request from "@/utils/request";
//资源相关的接口

//按条件分页查询资源
export const queryResource = (data = {}) => {
  return request({
    method: "POST",
    url: "/boss/resource/getResourcePages",
    //因为接口传输的数据是json格式,所以可以直接写data，不用a=10&b=20这种格式，不用转换成字符串
    data,
  });
};

//获取指定id的资源信息
export const getResource = (id) => {
  return request({
    method: "GET",
    url: `/boss/resource/${id}`,
  });
};

//保存或更新资源
export const resourceSaveOrUpdate = (data) => {
  return request({
    method: "POST",
    url: "/boss/resource/saveOrUpdate",
    data,
  });
};

//删除指定id的资源
export const deleteResource = (id) => {
  return request({
    method: "DELETE",
    // url: "/boss/resource/{id}",
    url: `/boss/resource/${id}`,
  });
};
